package cn.lg.controller;

import cn.lg.FeignClient.UserFeignClient;
import cn.lg.domain.User;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
public class feignController {

//    注入feign的客户端
    @Autowired
    private UserFeignClient userFeignClient;

    //浏览器来掉
    @RequestMapping("/pay/{id}")
    public User getById(@PathVariable("id")Long id){
        //使用Feign调用用户服务获取User
        return userFeignClient.getUser(id);
    }
}